package qnb.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import qnb.dao.SubjectDao;
import qnb.entity.Subject;
import qnb.service.SubjectService;

@Service
public class SubjectServiceImpl implements SubjectService {
	@Autowired
	private SubjectDao dao;
	
	/**
	 * 根据主键：查询一个对象
	 */
	@Override
	public Subject selectOne(Integer id) {
		return dao.selectOne(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see qnb.service.impl.SubjectService#select(java.lang.String,
	 * java.lang.String, int, int)
	 */
	@Override
	public List<Subject> select(
			// 条件
			String where,
			// 排序
			String oderby,
			// 分页
			int page, int pageSize) {
		return dao.select(where, oderby, page, pageSize);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see qnb.service.impl.SubjectService#count(java.lang.String)
	 */
	@Override
	public int count(String where) {
		return dao.count(where);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see qnb.service.impl.SubjectService#insert(qnb.entity.Subject)
	 */
	@Override
	public Integer insert(Subject obj) {
		return dao.insert(obj);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see qnb.service.impl.SubjectService#delete(java.lang.Integer)
	 */
	@Override
	public Integer delete(Integer id) {
		return dao.delete(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see qnb.service.impl.SubjectService#update(qnb.entity.Subject)
	 */
	@Override
	public Integer update(Subject obj) {
		return dao.update(obj);
	}

	@Override
	public List<Subject> selectAll() {
		// TODO Auto-generated method stub
		return dao.selectAll();
	}

	@Override
	public List<Subject> selectToDown(String where) {
		return dao.selectToDown(where);
	}

}
